/*
 * @Author: mindaier 844199821@qq.com
 * @Date: 2023-12-08 15:55:58
 * @LastEditors: mindaier 844199821@qq.com
 * @LastEditTime: 2023-12-20 17:29:32
 * @FilePath: /meet-panel-last/js/request.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// console.log('window.location.href', window.location.href);
// const devUrl = `http://10.2.205.86/seeyon/rest/jssdk`
// const prdUrl = `https://t51n957974.zicp.fun/seeyon/rest/jssdk` // /getGroupChat

const devUrl = `http://10.2.204.175:81/seeyon/rest` // meeting

var baseUrl = devUrl
// if(window.location.href.includes(`t51n957974.zicp.fun`)) {
//   baseUrl = devUrl
// } else {
//   baseUrl = prdUrl
// }
// const token = '68dccbba-66c7-4f28-b40b-6dd0d914454e'
// axios.defaults.headers.common['Authorization'] = `Bearer ${token}`; 
// axios.defaults.headers.common['Authorization'] = token; 

var getApi = (url, params) => {
  return new Promise((resolve, reject) => {
    axios.get(`${baseUrl}${url}`, { params: params }).then(res => {
      resolve(res.data)
    }).catch(err => {
      reject(err.data)
    })
  })
}

var postApi = (url, params) => {
  return new Promise((resolve, reject) => {
    axios.post(`${baseUrl}${url}`, { data: params }).then(res => {
      resolve(res.data)
    }).catch(err => {
      reject(err.data)
    })
  })
}


